import 'package:audioplayers/audioplayers.dart';
import 'package:flutter/material.dart';
import 'package:flutter6/util/player_util.dart';
import 'package:flutter_hooks/flutter_hooks.dart';
import '../../util/music_util.dart';
import '../../util/system_util.dart';
import '../../util/screen_util.dart';
import '../../widgets/global_navigation_bar.dart';
import '../../widgets/song_list.dart';
import '../../widgets/recommand_list.dart';
import 'header.dart';
import 'banner.dart';
import 'category.dart';

const songList1=[
  {'id': '43423', 'img': 'assets/tmp_cover_1.jpg', 'count': '9亿', 'title': '[华语新歌] 最新华语音乐专辑|最快最多最好最什么'},
  {'id': '666', 'img': 'assets/tmp_cover_2.jpg', 'count': '39.4亿', 'title': '今天从《Titan》听起|私人雷达'},
  {'id': '231', 'img': 'assets/tmp_cover_3.jpg', 'count': '16亿', 'title': 'aaa'},
  {'id': '333', 'img': 'assets/tmp_cover_4.jpg', 'count': '5321', 'title': 'bbb'},
  {'id': '788', 'img': 'assets/tmp_cover_5.jpg', 'count': '19万', 'title': 'ccc'},
  {'id': '344', 'img': 'assets/tmp_cover_6.jpg', 'count': '565', 'title': 'dddd'},
];

const recommendList1=[
  {'id': '1111', 'img': 'assets/tmp_cover_1.jpg', 'title': 'Tempest', 'artist': 'Capo Productions', 'tip': '你到不了的地方 音乐能带你去'},
  {'id': '1111', 'img': 'assets/tmp_cover_2.jpg', 'title': '岁月神偷', 'artist': '金玟岐', 'tip': 'aaa'},
  {'id': '1111', 'img': 'assets/tmp_cover_3.jpg', 'title': '最美的期待', 'artist': '周笔畅', 'tip': 'bbb'},
  {'id': '1111', 'img': 'assets/tmp_cover_4.jpg', 'title': '遥远的你', 'artist': 'xxxx', 'tip': 'xxx'},
  {'id': '1111', 'img': 'assets/tmp_cover_5.jpg', 'title': '遥远的你', 'artist': 'xxxx', 'tip': 'xxx'},
  {'id': '1111', 'img': 'assets/tmp_cover_6.jpg', 'title': '遥远的你', 'artist': 'xxxx', 'tip': 'xxx'},
];

class homePage extends HookWidget {
  const homePage({super.key});




  @override
  Widget build(BuildContext context) {
    setStatusBarStyle(Brightness.dark);
    var screen = Screen(context);
    return Scaffold(
      body: DefaultTextStyle(
        style: TextStyle(
          color: Color(0xff333333),
        ),
        child: SingleChildScrollView(
          padding: EdgeInsets.only(top: screen.top+screen.calc(7)),
          child: Container(
            decoration: BoxDecoration(
              color: Colors.white,
            ),
            child: Column(
              children: [
                Header(),
                MyBanner(),
                Category(),
                SongList(title: '你的歌单精选站', onMore: (){
                  Navigator.pushNamed(context, '/square');
                }, items: songList1),
                RecommendList(title: '根据 Red Dawn (a) 推荐', items: recommendList1, onMore: (){
                  print('more');
                }, onPlay: (id){
                  print('play: $id');
                },),
                Container(
                  height: screen.calc(100),
                ),
              ],
            ),
          ),
        ),
      ),
      bottomNavigationBar: GlobalNavigationBar(
        value: 0,
      ),
    );
  }
}
